const query = require('../config/sql');
const _ = require('lodash');
const { v4: uuidv4 } = require('uuid');
const dayjs=require('dayjs')
module.exports = async function setMessage(message) {
    let conversationId = uuidv4();
    let sql = 'insert into messagelist(conversationId,senderId,receiverId,message,cache,time) values(?,?,?,?,?,?);'
    await query(sql, [conversationId, message.senderId, message.receiverId, message.message,1,message.time])
}